﻿#pragma once

#include "Const.h"

// 游戏状态
typedef enum GameStatus {
    END,    // 已结束
    PLAYING // 游戏中

} GameStatus;

typedef struct Game Game;

typedef void (*GameDelete)(Game*);
typedef BOOL(*GameOnKeyPress)(Game*, UINT);
typedef void (*GameStart)(Game*);

// 游戏
struct Game {
    HWND mCallback;     // 回调
    HDC mDrawer;        // 绘图者
    HFONT mFont;        // 字体
    HWND mGameBoard;    // 游戏区域
    int mNumbers[GAME_BOARD_GRID_COUNT_V][GAME_BOARD_GRID_COUNT_H]; // 数字矩阵
    GameStatus mStatus; // 状态

    GameDelete deleteSelf;
    GameOnKeyPress onKeyPressed;
    GameStart start;
};

Game* New_Game(HWND, HDC, HWND);
